package com.meizi.core.tool.utils;

import org.springframework.http.HttpRequest;
import org.springframework.http.server.reactive.ServerHttpRequest;

import javax.servlet.http.HttpServletRequest;

/**
 * @author meizi
 * @email enjoymeizi@gmail.com
 * @date 2020/12/14 16:55
 */
public class JwtParsHander {
    static final String TOKNE_NAME = "access_token";
    public  static String getToken (HttpServletRequest request){
        String access_token = request.getHeader(TOKNE_NAME);
        return access_token;
    }

    public  static String getToken (ServerHttpRequest request){
        String access_token = request.getHeaders().getFirst(TOKNE_NAME);
        return access_token;
    }
}
